<template>
  <div class="content-area">
    <div class="fault-tracing-container">
      <h2>故障溯源页面</h2>
      <p>这里将展示报警的详细溯源信息和处置流程。</p>
      <p v-if="alarmId">报警ID: {{ alarmId }}</p>
      <p v-if="sensorId">传感器ID: {{ sensorId }}</p>
      <el-button @click="goBack" type="primary">返回</el-button>
    </div>
  </div>
</template>

<script setup>
import { defineProps } from 'vue'
import { useRouter } from 'vue-router'
import { ElButton } from 'element-plus'

const props = defineProps({
  alarmId: {
    type: String,
    default: 'N/A',
  },
  sensorId: {
    type: String,
    default: 'N/A',
  },
})

const router = useRouter()

const goBack = () => {
  router.go(-1) // 返回上一个页面
}
</script>

<style scoped>
.content-area {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  background-color: #f0f2f5;
}

.fault-tracing-container {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

h2 {
  color: #3f51b5;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.5em;
}
p {
  color: #555;
  margin-bottom: 10px;
}
</style>
